package com.ymatou.iapi.couponmanage.compare.writeapi;

import java.io.File;
import java.util.Arrays;

import org.json.JSONArray;

import com.ymatou.iapi.coupon.compare.CouponCompareAPI;
import com.ymatou.iapi.coupon.compare.comparebean.GetBatchInfoResp;
import com.ymt.core.tool.Logger;
import com.ymttest.utils.MapUtil;
import com.ymttest.utils.compare.CompareManager;

public class MainCompare {
	public final static String couponFolder = System.getProperty("user.dir") + File.separator + "resource" + File.separator
			+ "CompareData" + File.separator + "coupon_write" + File.separator;
	
	public final static boolean isIgnoreInfo = false;
	
	
	public static void compareGetBatchInfos() {
		String oldParamsFilePath = couponFolder + "old_batchCode.txt";
		String newParamsFilePath = couponFolder + "new_batchCode.txt";
		CompareManager.compareApiCall(oldParamsFilePath, newParamsFilePath,
										isIgnoreInfo,x->MapUtil.hashMap("BatchCodes", new JSONArray(Arrays.asList(x[0]))), 
										CouponCompareAPI.old_GetBatchInfosAPI, 
										CouponCompareAPI.GetBatchInfosAPI, 
										GetBatchInfoResp.class,
										"data");
		
	}
	
	
	public static void main(String args[]){
		Logger.setDebug(false);
		
		String num="1";
		if (args.length>0){
			num = args[0];
		}
		
		System.out.println(num);
		
		if (num.equals("1")){
			compareGetBatchInfos();
		}
	}
	
	
}
